GXCountShapePoints
You can use theGXCountShapePoints
function to determine the number of geometric points in a specific contour of a shape.
long GXCountShapePoints(gxShape source, long contour);
source
- A reference to the shape containing the contour.
contour
- The index of the contour whose geometric points you want to count.
- function result
- The number of points in the specified contour of the source shape.
DESCRIPTION
TheGXCountShapePoints
function returns as its function result the number of points in the contour specified by thecontour
parameter of the shape specified by thesource
parameter. If you pass 0 for thecontour
parameter, this function returns the total number of geometric points in the shape.For the geometric shapes with only one contour--points, lines, curves, and rectangles-- you must pass a 0 or a 1 in the
contour
parameter. For polygons and paths shapes, the value you provide for thecontour
parameter must be 0 or greater and must be equal to or less than the actual number of contours in the shape. For empty and full shapes, the function posts acontour_out_of_range
warning.If you provide a source shape that is not one of the geometric shape types, this function performs the actions described in the following table:
Shape type Action taken bitmap Returns 1 if the contour
parameter is 0 or 1; posts the errorcontour_out_of_range
otherwisepicture Posts the error graphic_type_does_not_contain_points
text Returns 1 if the contour
parameter is 0 or 1; posts the errorcontour_out_of_range
otherwiseglyph Returns the number of glyphs in the style run indicated by the contour
parameterlayout Returns the byte length of the style run indicated by the contour
parameterERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil graphic_type_does_not_contain_points (debugging version) Warnings contour_out_of_range SEE ALSO
For a discussion of geometric points, see the section "About Geometric Shapes" beginning on page 2-5.To learn how this function works for typographic shape types, see Inside Macintosh: QuickDraw GX Typography.
To determine the number of contours in a shape, use the
GXCountShapeContours
function, which is described on page 2-136.To determine the index of a particular geometric point within a shape, use the
GXGetShapeIndex
function, which is described in the next section.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help